
/* 

Paper: Gentrification and pioneer businesses 
Authors: Behrens, Boulam, Martin, Mayneris 

Name dofile: table3.do  
Version: 10 nov. 2021 

Output: table 3 on the stability of the list of pioneers  

Inputs:

 - pioneers_final_negbin.dta [produced in identify_pioneers_negbin.do] [publicly available]
 - pioneers_final_negbin_med.dta [produced in identify_pioneers_negbin_med.do] [publicly available]
 - pioneers_final_negbinalt.dta.dta [produced in identify_pioneers_negbin_alt.do] [publicly available]
 - pioneers_final_logit.dta [produced in identify_pioneers_logit.do] [publicly available]
 - pioneers_final_negbin_blkgrp.dta [produced in identify_pioneers_blkgrp.do] [publicly available]
 

*/ 

// weighted average vs median 
use "pioneers_final_negbin.dta", clear
keep naics pioneer_high naicsdescription
merge 1:1 naics using "pioneers_final_negbin_med.dta"
tab pioneer_high_negbin pioneer_high_negbin_med
tab2xl pioneer_high_negbin pioneer_high_negbin_med using table3, col(1) row(1) sheet("weighted vs median") replace

// negative binomial vs logit 
use "pioneers_final_negbin.dta", clear
keep naics pioneer_high naicsdescription
merge 1:1 naics using "pioneers_final_dum.dta"
tab pioneer_high_negbin pioneer_high_dum
tab2xl pioneer_high_negbin pioneer_high_dum using table3, col(1) row(1) sheet("binomial vs logit") 

// alternative definition of pioneers  
use "pioneers_final_negbin.dta", clear
keep naics pioneer_high naicsdescription
merge 1:1 naics using "pioneers_final_negbin_alt.dta"
tab pioneer_high_negbin pioneer_high_negbin_alt
tab2xl pioneer_high_negbin pioneer_high_negbin_alt using table3, col(1) row(1) sheet("alternative definition") 

// comparison block vs block groups
use "pioneers_final_negbin.dta", clear
keep naics pioneer_high naicsdescription
merge 1:1 naics using "pioneers_final_negbin_blkgrp.dta"
tab pioneer_high_negbin pioneer_high_negbin_blkgrp
tab2xl pioneer_high_negbin pioneer_high_negbin_blkgrp using table3, col(1) row(1) sheet("block group") 
